
cmake_minimum_required(VERSION 3.5.1)

project(file-annotation-tool LANGUAGES CXX VERSION 0.0.1)

include(cmake/SparkEnvConfig.cmake)
include(cmake/SparkMacrosConfig.cmake)
include(cmake/SparkFindLibraries.cmake)
include(cmake/SparkFindQt5Config.cmake)
include(cmake/SparkFindQt6Config.cmake)

# 资源文件路径
set(QRC_SOURCES "")

spark_add_executable_path(${PROJECT_NAME} src
    ${QRC_SOURCES}
)
target_link_qt5(${PROJECT_NAME})

include(cmake/SparkBuildGraphviz.cmake)

include(cmake/SparkDesktopMacros.cmake)
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    "${PROJECT_NAME}" # 应用名称: Name=
    "文件标注工具" # 应用名称: Name[zh_CN]=
    "一个简单的文件标注工具" # 应用说明: Comment=
    "Application" # 应用类型: Type=
    "/usr/bin/${PROJECT_NAME}" # 执行程序: Exec=
    "/usr/share/${PROJECT_NAME}/icon.png" # 图标路径: Icon=
    "Utility" # 应用分类: Category=
)

install(FILES ${DESKTOP_FILE}
    DESTINATION /usr/share/applications)

install(FILES assets/icon.png
    DESTINATION /usr/share/${PROJECT_NAME})

install(TARGETS ${PROJECT_NAME}
    DESTINATION /usr/bin)


# 注释行(使用方式)
find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)